﻿@{
    Layout = "~/Areas/PawRoot/Views/Shared/PawRootEdit.cshtml";
}

@model NoteInfo

@section HeadCss{
}
<div class="form-horizontal">
    <!--笔记标题-->
    <div class="form-group">
        <label class="col-sm-2 control-label">笔记标题：</label>
        <div class="col-sm-6">
            <input type="hidden" id="nId" value="@Model.NId" />
            <input type="text" class="form-control" id="title" placeholder="请输入标题名..." value="@Model.NTitle">
        </div>
        <label class="lot-blue">最大长度: 100 字符</label>
    </div>
    <!--笔记作者-->
    <div class="form-group">
        <label class="col-sm-2 control-label">笔记作者：</label>
        <div class="col-sm-6">
            <input type="text" class="form-control" id="author" placeholder="请输入作者名..." value="@Model.NAuthor">
        </div>
        <label class="lot-blue"></label>
    </div>
    <!--页面浏览-->
    <div class="form-group">
        <label class="col-sm-2 control-label">页面浏览：</label>
        <div class="col-sm-6">
            <input type="number" class="form-control" id="hitCount" placeholder="请输入浏览量..." value="@Model.NHitCount">
        </div>
    </div>
    <!--数据状态-->
    <div class="form-group">
        <label class="col-sm-2 control-label">数据状态：</label>
        <div class="col-sm-6">
            <select id="dataStatus" class="form-control">
                @{
                    if (Model.NDataStatus == StatusEnum.Deteled)
                    {
                        <option value="99">已删除</option>
                        <option value="1">未删除</option>
                    }
                    else
                    {
                        <option value="1">未删除</option>
                        <option value="99">已删除</option>
                    }
                }
            </select>
        </div>
    </div>
    <!--推送到主页-->
    <div class="form-group">
        <label class="col-sm-2 control-label">推荐类型：</label>
        <div class="col-sm-9">
            <div class="checkbox">
                <label>
                    <input type="checkbox" id="push" checked="@Model.NPush">推送到主页
                </label>
            </div>
        </div>
    </div>
    <!--展览小图-->
    <div class="form-group">
        <label class="col-sm-2 control-label" style="padding-top:13px;">展览小图：</label>
        <div class="col-sm-6">
            <span style="float:left;width:160px;"><span id="lot-uploader"></span></span><img id="displayPic" src="@Model.NDisplayPic" style="width:60px;height:33px;" />
        </div>
    </div>
    <!--笔记内容-->
    <div class="form-group">
        <label class="col-sm-2 control-label">笔记内容：</label>
        <div class="col-sm-6">
            <script id="container" name="content" type="text/plain">
                @Html.Raw(Model.NContent)
            </script>
        </div>
    </div>
    @*半自动化*@
    <div class="form-group">
        <label class="col-sm-2 control-label">半自动化：</label>
        <div class="col-sm-6">
            <button class="btn btn-primary" id="autoA">默认作者名</button>&nbsp;&nbsp;
            <button class="btn btn-warning" id="autoB">随机浏览量</button>&nbsp;&nbsp;
            <button class="btn btn-success" id="autoC">重置展览图</button>&nbsp;&nbsp;
            <button class="btn btn-primary" id="autoD">更新创建时间</button>&nbsp;&nbsp;
            <button class="btn btn-danger" id="autoE">自动分词（SEO Key）</button>
        </div>
    </div>
    <!--SEO关键字-->
    <div class="form-group">
        <label class="col-sm-2 control-label">SEO Key：</label>
        <div class="col-sm-6">
            <input type="hidden" id="seoId" value="@Model.NSeoId" />
            <input type="text" class="form-control" id="seoKeywords" placeholder="关键词1,关键词2,关键词3" value="@Model.SeoInfo.SeoKeywords">
        </div>
        <label class="lot-blue">本文的搜索关键词（4~5个高度相关的关键词）</label>
    </div>
    <!--SEO详细描述-->
    <div class="form-group">
        <label class="col-sm-2 control-label">SEO Des：</label>
        <div class="col-sm-6">
            <input type="text" class="form-control" id="seodescription" placeholder="请输入Seo详细描述..." value="@Model.SeoInfo.Sedescription">
        </div>
        <label class="lot-blue">本篇文章大概内容（最佳长度: 50 ~ 160 字符）</label>
    </div>
    <!--表单提交-->
    <div class="form-group">
        <input type="hidden" id="createTime" value="@Model.NCreateTime" />
        <label class="col-sm-2"></label>
        <div class="col-sm-6">
            <button id="form-success" class="btn btn-success lot-form-btn">提 交 文 章</button>
            <button id="form-gohome" class="btn btn-success lot-form-btn">返 回 列 表</button>
        </div>
    </div>
</div>
@section JsScript{
    <script src="/Areas/PawRoot/open/ueditor/ueditor.config.js"></script>
    <script src="/Areas/PawRoot/open/ueditor/ueditor.all.min.js"></script>
    <script src="/Areas/PawRoot/assets/js/note.min.js" async></script>
    <script type="text/javascript">
        //更新时间
        $('#autoD').click(function () {
            $('#createTime').val(new Date().getTime());
        });
        //提交表单
        $('#form-success').click(function () {
            ajaxToNote(true);
        });
    </script>
}